﻿using System.Threading;
using System.Windows.Forms;

namespace AnimeDLManager.Lib
{
	class Linkschecker
	{
		static readonly WebBrowser Web = new WebBrowser();

		//public static bool CheckLink(Uri uLink)
		//{
		//    return CheckLink(uLink.ToString());
		//}

		public static string CheckLink(string sLink)
		{
			if (sLink.ToLower().Contains("filesonic"))
			{
				Web.Navigate("http://linkylook.com/filesonic/" + sLink);

				do
				{
					Thread.Sleep(250);
				} while (Web.IsBusy);

				return Web.DocumentText;//.Contains("/images/ok.gif");
			}

			return "Null";
		}
	}
}
